package com.easou.ps.utils;

/**
 * 
 * 根据ss的定义，解析每个位的含义 debug 信息会用反射的方式调用这个类，显示pageType的意义 
 * 所以 pageType 的组合判断最好放到PageTypeHelper中
 * 
 * @author Administrator
 * 
 */

public class PageTypeUtil {

	/**
	 * 是否为博客页
	 * 
	 * @param pagetype
	 * @return
	 */
	private static final int BLOG = 1 << 0;

	public static boolean isBlog(int pageType) {
		return (pageType & BLOG) > 0;
	}

	/**
	 * 论坛页 类型定义、判断
	 */
	private static final int FORUM = 1 << 1;

	public static boolean isForum(int pageType) {
		return (pageType & FORUM) > 0;
	}

	/**
	 * 视频页 类型定义、判断
	 */
	private static final int VIDEO = 1 << 2;

	public static boolean isVideo(int pageType) {
		return (pageType & VIDEO) > 0;
	}

	/**
	 * Flash页 类型定义、判断
	 */
	private static final int FLASH = 1 << 3;

	public static boolean isFlash(int pageType) {
		return (pageType & FLASH) > 0;
	}

	/**
	 * HUB 类型定义、判断
	 */
	private static final int HUB = 1 << 4;

	public static boolean isHub(int pageType) {
		return (pageType & HUB) > 0;
	}

	private static final int SOFT_DOWNLOAD = 1 << 5;

	public static boolean isSoftDownload(int pageType) {
		return (pageType & SOFT_DOWNLOAD) > 0;
	}

	private static final int NEWS = 1 << 6;

	public static boolean isNews(int pageType) {
		return (pageType & NEWS) > 0;
	}

	/**
	 * 商情页 类型定义、判断
	 */
	private static final int BUSINESS = 1 << 7;

	public static boolean isBusiness(int pageType) {
		return (pageType & BUSINESS) > 0;
	}

	/**
	 * 高精度异变索引页 类型定义、判断
	 */
	private static final int EASYCHANGE = 1 << 8;

	public static boolean isEasyChange(int pageType) {
		return (pageType & EASYCHANGE) > 0;
	}

	/**
	 * 搜索结果页 类型定义、判断
	 */
	private static final int SEARCH = 1 << 9;

	public static boolean isSearch(int pageType) {
		return (pageType & SEARCH) > 0;
	}

	/**
	 * 图片页 类型定义、判断
	 */
	private static final int PICTURE = 1 << 10;

	public static boolean isPicture(int pageType) {
		return (pageType & PICTURE) > 0;
	}

	/**
	 * 小说页 类型定义、判断
	 */
	private static final int NOVEL = 1 << 11;

	public static boolean isNovel(int pageType) {
		return (pageType & NOVEL) > 0;
	}

	/**
	 * 黄页 类型定义、判断
	 */
	private static final int YELLOW = 1 << 12;

	public static boolean isYellow(int pageType) {
		return (pageType & YELLOW) > 0;
	}

	/**
	 * 供应页 类型定义、判断
	 */
	private static final int SUPPLY = 1 << 13;

	public static boolean isSupply(int pageType) {
		return (pageType & SUPPLY) > 0;
	}

	/**
	 * 音乐下载页 类型定义、判断
	 */
	private static final int MUSIC = 1 << 14;

	public static boolean isMusic(int pageType) {
		return (pageType & MUSIC) > 0;
	}

	/**
	 * 小说目录页 类型定义、判断
	 */
	private static final int NOVELDIR = 1 << 15;

	public static boolean isNovelDir(int pageType) {
		return (pageType & NOVELDIR) > 0;
	}

	private static final int MOBLIE_GAME = 1 << 16;

	public static boolean isMobileGame(int pageType) {
		return (pageType & MOBLIE_GAME) > 0;
	}

	private static final int WAP_THEME = 1 << 17;

	public static boolean isWapTheme(int pageType) {
		return (pageType & WAP_THEME) > 0;
	}

	private static final int CONTENT = 1 << 18;

	public static boolean isContent(int pageType) {
		return (pageType & CONTENT) > 0;
	}

	private static final int DOWNLOAD = 1 << 19;

	public static boolean isDownload(int pageType) {
		return (pageType & DOWNLOAD) > 0;
	}

	private static final int SPAM = 1 << 20;

	public static boolean isSpam(int pageType) {
		return (pageType & SPAM) > 0;
	}

	private static final int WENDA = 1 << 21;

	public static boolean isWenda(int pageType) {
		return (pageType & WENDA) > 0;
	}

	private static final int PORN = 1 << 22;

	/**
	 * 色情页
	 * 
	 * @param pageType
	 * @return
	 */
	public static boolean isPorn(int pageType) {
		return (pageType & PORN) > 0;
	}

	private static final int NEWS_LIST = 1 << 23;

	public static boolean isNewsList(int pageType) {
		return (pageType & NEWS_LIST) > 0;
	}

	private static final int MUSIC_DOWNLOAD = 1 << 24;

	public static boolean isMusicDownload(int pageType) {
		return (pageType & MUSIC_DOWNLOAD) > 0;
	}

	private static final int BAIKE = 1 << 25;

	public static boolean isBaike(int pageType) {
		return (pageType & BAIKE) > 0;
	}

	private static final int MOBILE = 1 << 26;

	public static boolean isMobile(int pageType) {
		return (pageType & MOBILE) > 0;
	}

	private static final int GAME = 1 << 27;

	public static boolean isGame(int pageType) {
		return (pageType & GAME) > 0;
	}

	private static final int BIGPIC = 1 << 28;

	public static boolean isBigPic(int pageType) {
		return (pageType & BIGPIC) > 0;
	}

	private static final int SMALL_PIC = 1 << 29;

	public static boolean isSmallPic(int pageType) {
		return (pageType & SMALL_PIC) > 0;
	}

	private static final int ONLINE_PLAY = 1 << 30;

	public static boolean isOnlinePlay(int pageType) {
		return (pageType & ONLINE_PLAY) > 0;
	}

	private static final long SOFT = 1L << 31;

	public static boolean isSoft(int pageType) {
		return (pageType & SOFT) > 0;
	}

}
